home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************/
- /* move the cursor to the beginnning of the previous word */
- /* Rexx errors are reported as RC= in the error message box */
- /* The return results of this program are reported on the */
- /* clipboard. */
- /****************************************************************/
- trace off
- options results
- 'get cursor'
- statement=result
- if rc = 0 then do
- 'cursor fetch'
- i=result
- /*
- The cursor counts from 0 to N-1.
- Rexx substrings count from 1 to N.
- */
- do while i > 0
- if substr(statement,i+1,1) ~= ' ' then leave
- i=i-1
- end
- do while i > 1
- i=i-1
- if substr(statement,i,1) ~= ' ' then do
- i=lastpos(' ',statement,i)
- 'cursor set' i
- exit 0
- end
- end
- 'cursor set 0'
- exit 0
- end
- return 3
-